# Copyright (c) 2020 Presto Labs Pte. Ltd.
# Author: donggu

load("@nazel//:nazel_build.bzl", "nazel_cc_binary")
load("@nazel//:nazel_build.bzl", "nazel_cc_library")


package(default_visibility = ["//visibility:public"])

nazel_cc_binary(
    name = "fastfeature_dumper",
    srcs = [
        "fastfeature_dumper.cc",
    ],
    deps = [
        "//cc/coin2",
        "@motion//papyrus:papyrus_nohyper",
    ],
)

nazel_cc_binary(
    name = "fastfeature_dumper2",
    srcs = [
        "fastfeature_dumper2.cc",
    ],
    deps = [
        "//cc/coin2",
    ],
)

nazel_cc_binary(
    name = "fastfeature_pta_dumper",
    srcs = [
        "fastfeature_pta_dumper.cc",
    ],
    deps = [
        "//cc/coin2",
    ],
)

nazel_cc_binary(
    name = "feed_dumper_papyrus",
    srcs = [
        "feed_dumper_papyrus.cc",
    ],
    deps = [
        "//cc/coin2",
        "@motion//papyrus",
    ],
)

nazel_cc_library(
    name = "option_util",
    srcs = [
        "util/lbfgs/lbfgs.cc",
    ],
    hdrs = [
        "util/option_util.h",
        "util/lbfgs/lbfgs.h",
        "util/lbfgs/arithmetic_ansi.h",
        "util/lbfgs/arithmetic_sse_double.h",
        "util/lbfgs/arithmetic_sse_float.h",
    ],
    deps = [
        "@eigen",
        "//cc/third_party:highfive",
    ],
    linkopts = [
        "-lfmt",
        "-lglog",
        "-ldw",
    ],
    defines = [
        "BACKWARD_HAS_DW=1",
    ]
)

nazel_cc_binary(
    name = "option_calculator",
    srcs = [
        "option_calculator.cc",
    ],
    deps = [
        ":option_util",
    ]
)

nazel_cc_binary(
    name = "option_dh_scenario",
    srcs = [
        "option_dh_scenario.cc",
    ],
    deps = [
        ":option_util",
    ]
)

nazel_cc_binary(
    name = "sabr_calibrator",
    srcs = [
        "sabr_calibrator.cc",
    ],
    deps = [
        ":option_util",
    ]
)
